﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<t_205_verk_hopur_12.Models.ScheduleIndexViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Dagskrá
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    
    <a href="/Channel/Schedule/<%= Model.Channel.ID %>/<%= Model.dayOfLastWeek.Year%>-<%= Model.dayOfLastWeek.Month%>-<%= Model.dayOfLastWeek.Day%>">Síðasta vika</a> /
    <a href="/Channel/Schedule/<%= Model.Channel.ID %>/<%= Model.dayOfNextWeek.Year%>-<%= Model.dayOfNextWeek.Month%>-<%= Model.dayOfNextWeek.Day%>">Næsta vika</a>  
   
    <p>&nbsp;</p>
    
    <h2>Dagskrá vikunnar</h2>
    
    <% if (Model.IsOwner)
       { %>
    <p>
        <%= Html.ActionLink("Breyta dagskrá", "EditSchedule", new { channelID = Model.Channel.ID })%>
    </p>
    <p>&nbsp;</p>
    <% } %>

    <div>
        <h2>Mánudagur</h2>
        <% if(Model.Week.ElementAt(0).Count() >= 1){ %>
        <table class="ScheduleTable">
            <% foreach(t_205_verk_hopur_12.Models.ScheduleVideo schedule in Model.Week.ElementAt(0)) 
               { %>
                <tr>
                    <td><b><%= Html.Encode(String.Format("{0:00}", schedule.StartTime.Hour))%>:<%= Html.Encode(String.Format("{0:00}", schedule.StartTime.Minute))%></b></td>
                    <td><%= Html.ActionLink(schedule.Title, "Index", "Channel", new { id = Model.Channel.ID, scheduleID = schedule.ID }, null)%></td>
                </tr>
            <% } %>
        </table>
       <% }
           else
           { %>
           <p>Engin dagskrá er þennan dag.</p>
        <% } %>
    </div>
    <p>&nbsp;</p>
    <div>
        <h2>Þriðjudagur</h2>
        <% if(Model.Week.ElementAt(1).Count() >= 1){ %>
        <table class="ScheduleTable">
            <% foreach(t_205_verk_hopur_12.Models.ScheduleVideo schedule in Model.Week.ElementAt(1)) 
               { %>
                <tr>
                    <td><b><%= Html.Encode(String.Format("{0:00}", schedule.StartTime.Hour))%>:<%= Html.Encode(String.Format("{0:00}", schedule.StartTime.Minute))%></b></td>
                    <td><%= Html.ActionLink(schedule.Title, "Index", "Channel", new { id = Model.Channel.ID, scheduleID = schedule.ID }, null)%></td>
                </tr>
            <% } %>
        </table>
       <% }
           else
           { %>
           <p>Engin dagskrá er þennan dag.</p>
        <% } %>
    </div>
    <p>&nbsp;</p>
    <div>
        <h2>Miðvikudagur</h2>
        <% if(Model.Week.ElementAt(2).Count() >= 1){ %>
        <table class="ScheduleTable">
            <% foreach (t_205_verk_hopur_12.Models.ScheduleVideo schedule in Model.Week.ElementAt(2)) 
               { %>
                <tr>
                    <td><b><%= Html.Encode(String.Format("{0:00}", schedule.StartTime.Hour))%>:<%= Html.Encode(String.Format("{0:00}", schedule.StartTime.Minute))%></b></td>
                    <td><%= Html.ActionLink(schedule.Title, "Index", "Channel", new { id = Model.Channel.ID, scheduleID = schedule.ID }, null)%></td>
                </tr>
            <% } %>
        </table>
       <% }
           else
           { %>
           <p>Engin dagskrá er þennan dag.</p>
        <% } %>
    </div>
    <p>&nbsp;</p>
    <div>
        <h2>Fimmtudagur</h2>
        <% if(Model.Week.ElementAt(3).Count() >= 1){ %>
        <table class="ScheduleTable">
            <% foreach (t_205_verk_hopur_12.Models.ScheduleVideo schedule in Model.Week.ElementAt(3)) 
               { %>
                <tr>
                    <td><b><%= Html.Encode(String.Format("{0:00}", schedule.StartTime.Hour))%>:<%= Html.Encode(String.Format("{0:00}", schedule.StartTime.Minute))%></b></td>
                    <td><%= Html.ActionLink(schedule.Title, "Index", "Channel", new { id = Model.Channel.ID, scheduleID = schedule.ID }, null)%></td>
                </tr>
            <% } %>
        </table>
       <% }
           else
           { %>
           <p>Engin dagskrá er þennan dag.</p>
        <% } %>
    </div>
    <p>&nbsp;</p>
    <div>
        <h2>Föstudagur</h2>
        <% if(Model.Week.ElementAt(4).Count() >= 1){ %>
        <table class="ScheduleTable">
            <% foreach (t_205_verk_hopur_12.Models.ScheduleVideo schedule in Model.Week.ElementAt(4)) 
               { %>
                <tr>
                    <td><b><%= Html.Encode(String.Format("{0:00}", schedule.StartTime.Hour))%>:<%= Html.Encode(String.Format("{0:00}", schedule.StartTime.Minute))%></b></td>
                    <td><%= Html.ActionLink(schedule.Title, "Index", "Channel", new { id = Model.Channel.ID, scheduleID = schedule.ID }, null)%></td>
                </tr>
            <% } %>
        </table>
       <% }
           else
           { %>
           <p>Engin dagskrá er þennan dag.</p>
        <% } %>
    </div>
    <p>&nbsp;</p>
    <div>
        <h2>Laugardagur</h2>
        <% if(Model.Week.ElementAt(5).Count() >= 1){ %>
        <table class="ScheduleTable">
            <% foreach (t_205_verk_hopur_12.Models.ScheduleVideo schedule in Model.Week.ElementAt(5)) 
               { %>
                <tr>
                    <td><b><%= Html.Encode(String.Format("{0:00}", schedule.StartTime.Hour))%>:<%= Html.Encode(String.Format("{0:00}", schedule.StartTime.Minute))%></b></td>
                    <td><%= Html.ActionLink(schedule.Title, "Index", "Channel", new { id = Model.Channel.ID, scheduleID = schedule.ID }, null)%></td>
                </tr>
            <% } %>
        </table>
       <% }
           else
           { %>
           <p>Engin dagskrá er þennan dag.</p>
        <% } %>
    </div>
    <p>&nbsp;</p>
    <div>
        <h2>Sunnudagur</h2>
        <% if (Model.Week.ElementAt(6).Count() >= 1)
           { %>
        <table class="ScheduleTable">
            <% foreach (t_205_verk_hopur_12.Models.ScheduleVideo schedule in Model.Week.ElementAt(6))
               { %>
                <tr>
                    <td><b><%= Html.Encode(String.Format("{0:00}", schedule.StartTime.Hour))%>:<%= Html.Encode(String.Format("{0:00}", schedule.StartTime.Minute))%></b></td>
                    <td><%= Html.ActionLink(schedule.Title, "Index", "Channel", new { id = Model.Channel.ID, scheduleID = schedule.ID }, null)%></td>
                </tr>
            <% } %>
        </table>
        <% }
           else
           { %>
           <p>Engin dagskrá er þennan dag.</p>
        <% } %>
    </div>
    <p>&nbsp;</p>
    <p>
       <%= Html.ActionLink("Til baka", "", new { id = Model.Channel.ID })%>
    </p>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="LogoText" runat="server">
    <%= Html.ActionLink(Model.Channel.Name, "Index", new { id = Model.Channel.ID }) %>
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="MenuBar" runat="server">
    <% Html.RenderPartial("ChannelMenuBar", new t_205_verk_hopur_12.Models.ChannelMenuViewModel(Model.Channel, Model.IsOwner)); %>
</asp:Content>
